<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: src/apps/sntp/sntp.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('sntp_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">sntp.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="sntp_8h.html">lwip/apps/sntp.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="opt_8h.html">lwip/opt.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="timeouts_8h.html">lwip/timeouts.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="udp_8h.html">lwip/udp.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="dns_8h.html">lwip/dns.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ip__addr_8h.html">lwip/ip_addr.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="pbuf_8h.html">lwip/pbuf.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="dhcp_8h.html">lwip/dhcp.h</a>&quot;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;time.h&gt;</code><br />
<code>#include &quot;arch/bpstruct.h&quot;</code><br />
<code>#include &quot;arch/epstruct.h&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsntp__time.html">sntp_time</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsntp__timestamps.html">sntp_timestamps</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsntp__msg.html">sntp_msg</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsntp__server.html">sntp_server</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:aebe74c93643ac9b8c8a9c7d223192c8f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sntp_8c.html#aebe74c93643ac9b8c8a9c7d223192c8f">SNTP_FRAC_TO_US</a>(f)&#160;&#160;&#160;((u32_t)(f) / 4295)</td></tr>
<tr class="separator:aebe74c93643ac9b8c8a9c7d223192c8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga9b300c6616de60524c85ea40bf70e2ba"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#ga9b300c6616de60524c85ea40bf70e2ba">sntp_init</a> (void)</td></tr>
<tr class="separator:ga9b300c6616de60524c85ea40bf70e2ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8119fc2d1ff7ff6eba511cc9c7167488"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#ga8119fc2d1ff7ff6eba511cc9c7167488">sntp_stop</a> (void)</td></tr>
<tr class="separator:ga8119fc2d1ff7ff6eba511cc9c7167488"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3fe5254e5a056fca80802d9f26b9c3c5"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#ga3fe5254e5a056fca80802d9f26b9c3c5">sntp_enabled</a> (void)</td></tr>
<tr class="separator:ga3fe5254e5a056fca80802d9f26b9c3c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaae94fb2adadbf9667e9597f8a45bf120"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#gaae94fb2adadbf9667e9597f8a45bf120">sntp_setoperatingmode</a> (u8_t operating_mode)</td></tr>
<tr class="separator:gaae94fb2adadbf9667e9597f8a45bf120"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae66404a551d5cef420cf844a71356fae"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#gae66404a551d5cef420cf844a71356fae">sntp_getoperatingmode</a> (void)</td></tr>
<tr class="separator:gae66404a551d5cef420cf844a71356fae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac8097829a81cb6f37d9acf8efb2cc82e"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#gac8097829a81cb6f37d9acf8efb2cc82e">sntp_getreachability</a> (u8_t idx)</td></tr>
<tr class="separator:gac8097829a81cb6f37d9acf8efb2cc82e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4fa038dcea66349fafdbe1cc3e52ff3a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#ga4fa038dcea66349fafdbe1cc3e52ff3a">sntp_setserver</a> (u8_t idx, const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *server)</td></tr>
<tr class="separator:ga4fa038dcea66349fafdbe1cc3e52ff3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2a28523cb9f2b5b025a4818bc2c1afc1"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#ga2a28523cb9f2b5b025a4818bc2c1afc1">sntp_getserver</a> (u8_t idx)</td></tr>
<tr class="separator:ga2a28523cb9f2b5b025a4818bc2c1afc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>SNTP client module </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="aebe74c93643ac9b8c8a9c7d223192c8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aebe74c93643ac9b8c8a9c7d223192c8f">&#9670;&nbsp;</a></span>SNTP_FRAC_TO_US</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SNTP_FRAC_TO_US</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">f</td><td>)</td>
          <td>&#160;&#160;&#160;((u32_t)(f) / 4295)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Convert NTP timestamp fraction to microseconds. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_53adf0b982dc8545998aae3f283a5a58.html">apps</a></li><li class="navelem"><a class="el" href="dir_e7856a6aeaebbc124e80ad9550aedba4.html">sntp</a></li><li class="navelem"><a class="el" href="sntp_8c.html">sntp.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
